import binascii
from gm.sm2 import Sm2Key

def test():
    key = Sm2Key('b08820479c40797ba8452368595cdc6d7207580828d74ae1c9aa9f0e50fa71bd')
    print('Private Key: ' + key.private_key)
    print('Public Key: ' + key.public_key)
    print('Address: ' + key.address)

    # Both input and output are hex string
    signature = key.sign_rsv('0bcd6b3443395d66fadb3fb96f36980864765d8cbb47ce982e139fa4801a6053')
    print('Signature: ' + signature)

    # Both input and output are hex string
    signature = key.sign_rsv_with_sm3(binascii.b2a_hex(b'hello world'))
    print('Signature: ' + signature)
